package me.cxlr.qinlauncher2.dao;

import io.realm.RealmConfiguration;

/**
 * @author 酷安用户:山轮纸
 */
public class RealmConfig {

    public static final Long DATABASE_VERSION = 2L;
    public static final String DATABASE_NAME = "realm_database";

    /**
     * 获取当前正在使用的账本数据库
     *
     * @return 当前正在使用的账本数据库的RealmConfiguration
     */
    public static RealmConfiguration getRealmConfig() {

        RealmConfiguration config = new RealmConfiguration.Builder()
                //数据库名字
                .name(DATABASE_NAME)
                //数据库版本
                .schemaVersion(DATABASE_VERSION)
                .allowQueriesOnUiThread(true)
                .allowWritesOnUiThread(true)
                .migration(new DataBaseMigration())
                .build();

        return config;
    }
}
